package com.why.zing.alipay.constant;

import com.google.gson.JsonElement;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.why.zing.alipay.util.Utils;

import java.lang.reflect.Type;
import java.util.List;


public class TradeInfoAdapter implements JsonSerializer<List<TradeInfo>> {
    @Override
    public JsonElement serialize(List<TradeInfo> tradeInfoList, Type type, JsonSerializationContext jsonSerializationContext) {
        if (Utils.isListEmpty(tradeInfoList)) {
            return null;
        }
        return jsonSerializationContext.serialize(tradeInfoList);
    }
}
